Skip to content

Fix dynamic secret selection false positives in strict linting - #80581

Merged
pelikhan merged 6 commits into
mainfrom
pelikhan/strict-workflow-compilation
Nov 24, 2026
Merged

pelikhan merged 6 commits into
mainfrom
pelikhan/strict-workflow-compilation

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: e6d6da4035b31896f3907acf82330dc3f38cc07b

Dimension Assessment Rationale
Change confidence 9.5/10 ↑ Actions and AW regression tests cover dynamic selection and nested whole-context exposure.
↑ Threat-mapping contract tests and full repository validation pass; all 371 workflows compile successfully.
Diagnosis confidence 10/10 ↑ Literal-only index exemption incorrectly classified dynamic single-secret lookup as whole-context exposure.
↑ Regression tests fail before the fix and pass afterward.
Evidence fit 9/10 ↑ Regression reproduces the exact repository-to-secret mapping expression reported by gh-cao.
↓ Full gh-cao workflow compilation was not rerun.

Strict linting incorrectly reported dynamically indexed secret lookups as exposing the entire secrets context. A repository-to-secret-name mapping selects one value, rather than serializing all secrets.

Allow indexed single-secret selection while continuing to inspect selector expressions for whole-context use. toJSON(secrets), wildcard projections, and whole-context exposure nested inside selectors remain blocked. Selector trust and independent secret-disclosure checks are unchanged.

Adds regression coverage for both Actions and AW inputs, documents the distinction, and extracts environment traversal into a helper to satisfy the function-length limit without changing behavior. Compiler threat specification 1.0.110 records the boundary, maps the rule to CTR-017, and keeps registry metadata and its contract tests synchronized.

Validation: workflow lint suite, focused regression and threat-mapping tests, and make agent-report-progress pass. All 371 repository workflows compile successfully; existing warnings remain. No workflows were executed.

pelikhan and others added 2 commits November 23, 2026 16:09
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review November 24, 2026 00:18
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 00:18
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 7.1K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

The [aw] No-Op Runs tracker omits agent messages. The category uses structured run status, not interpretation of agent prose.

No-op message

Lean already. Ship.

Generated by Ponytail Reviewer for #80581 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ⊞ 176 · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 7.4K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

The [aw] No-Op Runs tracker omits agent messages. The category uses structured run status, not interpretation of agent prose.

No-op message

PR #80581 advanced from reviewed head 45f22a6 to e6d6da4 before publication; discarded pending specification updates and did not publish a stale review.

Generated by PR Specification Reviewer for #80581 · copilot · gpt56 · ~8 AIC · ⌖ ~1 AIC · ⊞ 1.8K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K · history

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed lines. I found no actionable correctness, performance, or maintainability issues blocking this change. The dynamic selector behavior is covered by the added Actions and AW cases, while nested whole-context references remain rejected.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-1fdc60e0-20ee-4981-888f-4ad4a77a3024","parents":[],"payload":{"id":"ldg-9e9de5d7-ef95-4554-870f-fb9f9cc456c0","operation":"append","value":{"finding_count":0,"head_sha":"45f22a6a7154e40dc891882078539845b509e0a1","outcome":"no_findings"}},"sha":"sha256:604f88178169c410259d30a11d18b4586a4cfbd3d7516a50139dc44d0f17c2e5","timestamp":"2026-11-24T00:26:09.848Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-5461cbde-a54b-4585-a616-3a6581e8afb2","parents":[],"payload":{"id":"ldg-467f3699-b9a3-4076-9b40-7d19c2602644","operation":"append","value":{"finding_count":0,"head_sha":"45f22a6a7154e40dc891882078539845b509e0a1","outcome":"incomplete"}},"sha":"sha256:76fe9262eda76aae9141c4953a452358da2c94f5727f04e643b76582dc57c097","timestamp":"2026-11-24T00:27:59.129Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd. The fix is correct and the core logic holds: dynamic single-secret selection is no longer flagged, while whole-context use (toJSON(secrets), wildcard projections, and whole-context inside a selector) stays blocked. Focused tests pass (go test ./pkg/workflow/lint/ -run OverprovisionedSecrets).

📋 Key Themes & Highlights

Key Themes

  • Coverage gap: the removed sandbox.agent.env.PICK expectation leaves the sandbox.agent.env walker without a blocking case (see inline comment).
  • Behavior change: dynamic secrets[...] selectors are no longer reported here. The taint layer still tracks them into sinks, so disclosure checks are unchanged.

Positive Highlights

  • ✅ Regression tests cover both sides of the distinction, including nested selectors.
  • ✅ The walkOverprovisionedSecretsEnv extraction is behavior-preserving.
  • ✅ The docs row accurately describes the new policy.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 7.1K
Comment /matt to run again

"jobs.remote.secrets": Error,
"jobs.local.secrets": Warning,
"steps[0].env.ALL": Error,
"engine.env.ALL": Error,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] This removes the only assertion covering whole-context exposure under sandbox.agent.env. The input still uses PICK as a dynamic index, which is now correctly allowed, so nothing exercises the sandbox branch of walkOverprovisionedSecretsEnv. Dropping that branch would still pass CI.

💡 Suggested test

Add a whole-context entry such as ALL: '${{ toJSON(secrets) }}' under sandbox.agent.env in the input, and expect sandbox.agent.env.ALL to be Error in the map. Keep PICK as the dynamic-index case that should pass.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the sandbox whole-context regression assertion in 3c4e3c96.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

✅ Test Quality Score: 90/100 — Excellent

Analyzed 9 test(s): 9 design, 0 implementation, 0 violation(s).

📊 Metrics (9 tests)
Metric Value
Analyzed 9 (Go: 9, JS: 0)
✅ Design 9 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 9 (100%)
Duplicate clusters 0
Inflation YES: 68 test lines added vs 21 production lines added (~3.2:1)
🚨 Violations 0
Test File Classification Issues
TestOverprovisionedSecretsSelectors safe rows (3) overprovisioned_secrets_test.go:155 behavioral_contract, high_value, design_test None
TestOverprovisionedSecretsSelectors blocked rows (4) overprovisioned_secrets_test.go:155 behavioral_contract, high_value, design_test None
TestOverprovisionedSecretsActions (dynamic index row) overprovisioned_secrets_test.go:51 behavioral_contract, high_value, design_test None
TestOverprovisionedSecretsAuthored overprovisioned_secrets_test.go:132 behavioral_contract, high_value, design_test Coverage gap (see flagged)
⚠️ Flagged Tests (1, non-blocking)

TestOverprovisionedSecretsAuthored (overprovisioned_secrets_test.go:132): The removed sandbox.agent.env.PICK expectation was the only positive assertion for the sandbox.agent.env walk in this file. A regression that stops flagging whole-context secrets in sandbox.agent.env would now pass. Suggested fix: add a sandbox.agent.env case such as ALL: ${{ toJSON(secrets) }} expecting Error.

Verdict

✅ passed. 0% implementation tests (threshold: 30%). No guideline violations.
Static review only: local go test execution was not permitted in this run.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 7.4K · history
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). No guideline violations. Non-blocking: see flagged coverage gap in the comment above.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 7.4K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical secret-handling gaps allow computed references to bypass placement checks and redaction, while the threat-ID remapping can suppress previously reported strict-workflow errors.

3 open issues
What changed in this PR

This PR refines gh-aw’s secret-exposure linting so dynamic single-secret lookups are not mistaken for whole-context exposure. It retains checks for whole-context use nested inside selectors.

Changes:

  • Accepts dynamic secret indexes and adds Actions/AW regression coverage.
  • Extracts AW environment traversal into a helper.
  • Maps overprovisioned-secrets to CTR-017 and updates the specification and reference docs.
File Description
specs/​compiler-threat-detection-spec.md Defines the selection boundary in version 1.0.110 and adds the threat mapping.
specs/​compiler-threat-detection-changelog.md Records the policy clarification and regression evidence.
pkg/​workflow/​lint/​rule_contract_test.go Adds the CTR-017 mapping to the rule contract.
pkg/​workflow/​lint/​overprovisioned_secrets.go Accepts dynamic indexes and extracts environment traversal.
pkg/​workflow/​lint/​overprovisioned_secrets_test.go Covers accepted selectors and blocked nested exposure.
docs/​src/​content/​docs/​reference/​workflow-linters.md Documents the rule’s selection boundary and severity policy.

Review effort: Max (adaptive)

Targets: ActionsAST | AWAST,
Check: checkOverprovisionedSecrets,
ID: "overprovisioned-secrets",
ThreatRuleID: "CTR-017",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CTR-017 suppressions no longer suppress overprovisioned-secrets; added strict-mode regression coverage in 3c4e3c96.

}
case *actionlint.IndexAccessNode:
if _, literal := parent.Index.(*actionlint.StringNode); literal && parent.Operand == child {
if parent.Operand == child {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computed selectors are now fingerprinted for safe-update checks, redacted, and bounded by explicit workflow_call secret names. Added generated-workflow regression coverage in db5c641e.

}
case *actionlint.IndexAccessNode:
if _, literal := parent.Index.(*actionlint.StringNode); literal && parent.Operand == child {
if parent.Operand == child {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computed secret references are now included in step secret classification, so env bindings are rejected when the step writes to GITHUB_ENV; added a regression in db5c641e.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/lint/overprovisioned_secrets_test.go:151): address unresolved feedback - Review comment
  3. Review (pkg/workflow/lint/overprovisioned_secrets.go:20): address unresolved feedback - Review comment
  4. Review (pkg/workflow/lint/overprovisioned_secrets.go:201): address unresolved feedback - Review comment
  5. Review (pkg/workflow/lint/overprovisioned_secrets.go:201): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "e6d6da4035b31896f3907acf82330dc3f38cc07b",
  "kind": "requested",
  "schema_version": "1",
  "state": "314633a37b767081a40d7aac0df568f73e0113c285b4a1754a5c1416e75a316f",
  "work": [
    "1cac9374b23e91c6955ec8e4640539b427aed92d430e517e469a3fa0c715aed0",
    "8a7ab16d206078f4134482787035be96d5dfa43853c0ec6bff14f9f22a6e26ce",
    "b1395227911e8585fc5940fee2929b8f5cca78da5c4d4e41d5ac2941029c8eff",
    "ea087b1859de2bceb9aa0eab75e9c1e0de2411651472bea03484b917c9371973"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · history
Comment /souschef to run again

gh-aw-bot and others added 3 commits November 24, 2026 01:07
…low-compilation

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
// buildSafeUpdateError creates a clear, structured error message that names the
// offending secrets, actions, and redirects and tells the user how to remediate.
func buildSafeUpdateError(secretViolations, addedActions, removedActions []string, addedRedirect, removedRedirect string, hasPullRequestTargetEscalation bool, memoryValidationScriptChanges []string) error {
func buildSafeUpdateError(secretViolations, addedActions, removedActions []string, addedRedirect, removedRedirect string, hasPullRequestTargetEscalation bool, memoryValidationScriptChanges []string, dynamicSecretViolations ...[]string) error {
@pelikhan
pelikhan merged commit 6493817 into main Nov 24, 2026
124 checks passed
@pelikhan
pelikhan deleted the pelikhan/strict-workflow-compilation branch November 24, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants